package com.cta.dao.report.impl;

import java.sql.SQLException;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class JDBCDao {

	private JdbcTemplate jdbcTemplate;

	@Autowired
	public void setDataSource(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}

	public void execute(String sql) throws SQLException {
		jdbcTemplate.execute(sql);
	}
	
	public void insert(String sql, Object[] params) throws SQLException {
		jdbcTemplate.update(sql, params);
	}
}
